#!/bin/sh

TEMP_FILE=$(mktemp -p ${PWD} plotter.XXXXXXXXXX) && {
    
    ./test-fft -v ${@} > ${TEMP_FILE}
    
    gnuplot <<_EOF
set terminal jpeg
set output "${TEMP_FILE}.jpeg"
set title "Andamento FFT e DFT"
plot [0:255] "${TEMP_FILE}" using 1:2 title "FFT" lt rgb "blue" with lp, "${TEMP_FILE}" using 1:3 title "DFT" lt rgb "orange" with lp
_EOF

    rm -f "${TEMP_FILE}"
}
